import request from './request.js'

//登录
export function login(params) {
	return request({
		url: '/app/pub/wx/login',
		method: 'POST',
		params: params
	})
}
// 新增地址
export function addAddress(params) {
	return request({
		url: '/consignee',
		method: 'POST',
		params: params
	})
}
//修改地址
export function updataAddress(params) {
	return request({
		url: '/consignee',
		method: 'PUT',
        params: params
	})
}
//删除地址
export function deleteAddress(ids) {
	return request({
		url: '/consignee/' + ids,
		method: 'DELETE',

	})
}
//获取默认提货人
export function getConsignee() {
	return request({
		url: '/consignee/default',
		method: 'GET',
	})

}
//获取地址列表
export function getAddressList(params) {
	return request({
		url: '/consignee',
		method: 'GET',
		params: {
			page: 1,
			limit: 100
		}
	})

}

//查询商品分类
export function getCategoryList(params) {
	return request({
		url: '/commodity/category/forApp',
		method: 'GET',
	})
}

//获取微信用户类别
export function getWxType() {
	return request({
		url: '/wx/user/type',
		method: 'GET',
	})
}

//上传文件
export function uploadFile(filePath) {
	return request({
		url: '/attachment/upload',
		method: 'POST',
		filePath:filePath
	})
}
